package part4createthread;


/**
 * @description: 继承Thread类，重写run方法，调用start开启线程
 * @date: 2022/10/5 16:24.
 * @version: 1.0
 */
public class CreateThreadDemo01 extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 200; i++) {
            System.out.println("子线程在工作--" + i);
        }
    }

    public static void main(String[] args) {

        CreateThreadDemo01 createThreadDemo01 = new CreateThreadDemo01();
        createThreadDemo01.start();

        for (int i = 0; i < 200; i++) {
            System.out.println("主线程在工作--" + i);
        }
    }


}
